package com.im.service.service;

import com.im.service.infra.entity.ImUser;
import com.im.service.infra.repository.ImUserRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

@Service
@RequiredArgsConstructor
@Slf4j
public class ImUserService {
    private final ImUserRepository imUserRepository;

    public Mono<ImUser> findByUserId(String userId) {
        return imUserRepository.findById(userId);
    }

    public Mono<ImUser> saveOrUpdate(ImUser imUser) {
        return imUserRepository.save(imUser);
    }
}
